package com.zaofan.service;

import java.util.HashMap;
import java.util.Map;

import com.zaofan.bean.Setting;
import com.zaofan.dao.SettingDao;

public class SettingService {
	private SettingDao settingDao = new SettingDao();

	public void update(Setting setting) {
		Setting data = findSetting();
		setting.setJpushSendTime(data.getJpushSendTime());
		setting.setOrderTimeOut(data.getOrderTimeOut());
		setting.setGoodsOrderTimeOut(data.getGoodsOrderTimeOut());
		settingDao.update(setting);
	}

	public Setting findSetting() {
		Map<String, Object> params = new HashMap<>();
		params.put("id", 1);
		return settingDao.findOne(params);
	}

}
